using System;
using System.Collections.Generic;
using System.Text;

namespace TntOrm.Attributes
{
    [AttributeUsage( AttributeTargets.Property )]
    public class OrmCrossReference : Attribute
    {
        private Type _CrossTable;

        public Type CrossTable
        {
            get { return _CrossTable; }
            set { _CrossTable = value; }
        }

        private Type _ObjectType;

        public Type ObjectType
        {
            get { return _ObjectType; }
            set { _ObjectType = value; }
        }

        private string _ObjectPrimaryKey;

        public string ObjectPrimaryKey
        {
            get { return _ObjectPrimaryKey; }
            set { _ObjectPrimaryKey = value; }
        }

        private string _LookUpField;

        public string LookUpField
        {
            get { return _LookUpField; }
            set { _LookUpField = value; }
        }

        private string _CrossReferenceName;

        public string CrossReferenceName
        {
            get { return _CrossReferenceName; }
            set { _CrossReferenceName = value; }
        }


        public OrmCrossReference( string Name, Type TableCross, 
                                    Type ObjectsType, string ObjectsPrimaryKey, string FieldLookUp )
        {
            this._CrossReferenceName = Name;
            this._CrossTable = TableCross;
            this._ObjectPrimaryKey = ObjectsPrimaryKey;
            this._ObjectType = ObjectsType;
            this._LookUpField = FieldLookUp;
        }
    }
}